<html>
    <head>
        <script src="../OLLoader.js"></script>
        <script type="text/javascript">    

            function test_constructor(t) {
                t.plan(6);        
                var xml = document.getElementById("capabilities").firstChild.nodeValue;
                var doc = new OpenLayers.Format.XML().read(xml);
                var obj = new OpenLayers.Format.WMTSCapabilities().read(doc);
            
                var layer0 = new OpenLayers.Layer.WMTS({
                    name: "GeoWebCache USA WMTS", 
                    url: "http://example.com/geowebcache-1.2.2/service/wmts/",
                    layer: "arcgis-online-wms",
                    style: "",
                    matrixSet: "arcgis-online-wgs84",                
                    format: "image/png",
                    isBaseLayer: false,
                    requestEncoding: "KVP",
                    maxResolution: 0.3521969032857032,
                    numZoomLevels: 7,
                    matrixIds: obj.contents.tileMatrixSets["arcgis-online-wgs84"].matrixIds
                });

                t.ok(layer0 instanceof OpenLayers.Layer.WMTS, "constructor returns instance of OpenLayers.Layer.WMTS");
                t.eq(layer0.formatSuffix, "png", "formatSuffix is set correct based on 'format' parameter");
                
                var layer1 = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",  
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),            
                    requestEncoding: "REST"            
                });

                t.ok(layer1 instanceof OpenLayers.Layer.WMTS, "constructor returns instance of OpenLayers.Layer.WMTS");
                t.eq(layer1.formatSuffix, "jpg", "formatSuffix is set correct based on default format");
                t.eq(layer1.tileSize.w, 512.0, "tileSize w is set correctly");
                t.eq(layer1.tileSize.h, 512.0, "tileSize h is set correctly");
            }

            function test_moveTo(t) {
                t.plan(9);        
                var xml = document.getElementById("capabilities").firstChild.nodeValue;
                var doc = new OpenLayers.Format.XML().read(xml);
                var obj = new OpenLayers.Format.WMTSCapabilities().read(doc);
            
                var layer0 = new OpenLayers.Layer.WMTS({
                    name: "GeoWebCache USA WMTS", 
                    url: "http://example.com/geowebcache-1.2.2/service/wmts/",
                    layer: "arcgis-online-wms",
                    style: "foo",
                    matrixSet: "arcgis-online-wgs84",    
                    format: "image/png",
                    requestEncoding: "KVP",
                    maxResolution: 0.3521969032857032,
                    numZoomLevels: 7,
                    matrixIds: obj.contents.tileMatrixSets["arcgis-online-wgs84"].matrixIds
                });   

                var map = new OpenLayers.Map('map');
                map.addLayer(layer0);
                
                map.setCenter(new OpenLayers.LonLat(-97, 38), 1);
                
                t.ok((layer0.tileOrigin instanceof OpenLayers.LonLat), "tileOrigin is an instance of OpenLayers.LonLat");
                t.ok((layer0.tileOrigin.lon == -180 && layer0.tileOrigin.lat == 90), "tileOrigin is set correctly");
                t.ok((layer0.tileSize instanceof OpenLayers.Size), "tileSize is an instance of OpenLayers.Size");
                t.eq(layer0.tileSize.w, 256.0, "tileSize w is set correctly");
                t.eq(layer0.tileSize.h, 256.0, "tileSize h is set correctly");

                map.setCenter(new OpenLayers.LonLat(-97.0, 38.0), 6);
                
                t.eq(layer0.tileOrigin.lon, -175, "tileOrigin.lat updated correctly when zoom changed"); 
                t.eq(layer0.tileOrigin.lat, 85, "tileOrigin.lat updated correctly when zoom changed");                
                t.eq(layer0.tileSize.w, 512.0, "tileSize w updated correctly when zoom changed");
                t.eq(layer0.tileSize.h, 512.0, "tileSize h updated correctly when zoom changed");                    

                map.destroy();
            }

            function test_clearTiles (t) {
                t.plan(1);
                var map = new OpenLayers.Map('map');

                var layer1 = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),            
                    requestEncoding: "REST"            
                });
                
                map.addLayer(layer1);
                map.setCenter(new OpenLayers.LonLat(0,0));

                //grab a reference to one of the tiles
                var tile = layer1.grid[0][0];        

                layer1.clearGrid();

                t.ok( layer1.grid != null, "layer.grid does not get nullified" );
                map.destroy();
            }

            function test_getTilesBounds(t) {
                t.plan(1);
                var layer1 = new OpenLayers.Layer.WMTS({ 
                    name: "Blue Marble WMTS",  
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),            
                    requestEncoding: "REST"            
                });
                var bl = {bounds: new OpenLayers.Bounds(1,2,2,3)};
                var tr = {bounds: new OpenLayers.Bounds(2,3,3,4)};
                layer1.grid = [[6, tr],[bl, 7]];
                var bounds = layer1.getTilesBounds();            
                var testBounds = new OpenLayers.Bounds(1,2,3,4);                
                t.ok(bounds.equals(testBounds), "correct bounds");                
            }

            function test_getResolution(t) {
                t.plan(1);
                var map = new OpenLayers.Map('map');
                var layer1 = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",  
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),  
                    maxResolution: 1.40625,          
                    requestEncoding: "REST"            
                });
                map.addLayer(layer1);
                map.zoom = 5;
                t.eq(layer1.getResolution(), 0.0439453125, "getResolution() returns correct value");
                map.destroy();
            }

            function test_getZoomForExtent(t) {
                t.plan(2);
                var bounds, zoom;

                var map = new OpenLayers.Map('map');
                var layer1 = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",  
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),       
                    maxResolution: 1.40625,     
                    requestEncoding: "REST"            
                });                                
                map.addLayer(layer1);
                bounds = new OpenLayers.Bounds(10,10,12,12);
                zoom = layer1.getZoomForExtent(bounds);
                t.eq(zoom, 8, "correct value for (10,10,12,12)");
                bounds = new OpenLayers.Bounds(10,10,100,100);
                zoom = layer1.getZoomForExtent(bounds);
                t.eq(zoom, 3, "correct value (10,10,100,100)");
                map.destroy();
            }   

            function test_getURL(t) {
                t.plan(2);
                var xml = document.getElementById("capabilities").firstChild.nodeValue;
                var doc = new OpenLayers.Format.XML().read(xml);
                var obj = new OpenLayers.Format.WMTSCapabilities().read(doc);
            
                var layer0 = new OpenLayers.Layer.WMTS({
                    name: "GeoWebCache USA WMTS", 
                    url: "http://example.com/geowebcache-1.2.2/service/wmts/",
                    layer: "arcgis-online-wms",
                    style: "foo",
                    matrixSet: "arcgis-online-wgs84",                
                    format: "image/png",
                    requestEncoding: "KVP",
                    maxResolution: 0.3521969032857032,
                    numZoomLevels: 7,
                    matrixIds: obj.contents.tileMatrixSets["arcgis-online-wgs84"].matrixIds
                }); 
                 
                var layer1 = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",  
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    format: "image/jpeg",
                    tileSize: new OpenLayers.Size(512, 512),            
                    requestEncoding: "REST",
                    isBaseLayer: false            
                });     

                var options = {
                    controls: [            
                        new OpenLayers.Control.LayerSwitcher(),
                        new OpenLayers.Control.Navigation(),   
                        new OpenLayers.Control.PanZoom()
                    ],
                    projection: "EPSG:4326",                                    
                    maxResolution: 0.3515625,
                    maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
                };    
                var map = new OpenLayers.Map('map', options);
                map.addLayers([layer0,layer1]);
                map.setCenter(new OpenLayers.LonLat(-97.0, 38.0), 1);
                var tileurl0 = layer0.getURL(new OpenLayers.Bounds(-135.0, 0.0, -90.0, 45.0));
                t.ok(OpenLayers.Util.isEquivalentUrl(tileurl0, "http://example.com/geowebcache-1.2.2/service/wmts/?LAYER=arcgis-online-wms&STYLE=foo&TILEMATRIXSET=arcgis-online-wgs84&FORMAT=image%2Fpng&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&TILEMATRIX=arcgis-online-wgs84%3A1&TILEROW=1&TILECOL=1"), "layer0 getURL returns correct url");

                var tileurl1 = layer1.getURL(new OpenLayers.Bounds(-180.0, 0.0, -90.0, 90.0));
                t.eq(tileurl1, "http://example.com/wmts/1.0.0/world/blue_marble/arcgis_online/1/0/0.jpg", "layer1 getURL returns correct url");                                        
                map.destroy();
            }

            function test_getURL_resourceUrl(t) {
                t.plan(2);
            
                var xml = document.getElementById("capabilities").firstChild.nodeValue;
                var doc = new OpenLayers.Format.XML().read(xml);
                var obj = new OpenLayers.Format.WMTSCapabilities().read(doc);

                var template = "http://www.example.com/{style}/{Time}/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png";
                var layer = new OpenLayers.Layer.WMTS({
                    requestEncoding: "REST",
                    url: template,
                    layer: "GeoWebCache_USA_WMTS",
                    style: "foo",
                    matrixSet: "arcgis-online",
                    params: {Time: "2011"},
                    dimensions: ["Time"]
                });   

                var map = new OpenLayers.Map("map", {
                    layers: [layer],
                    projection: "EPSG:4326",                                    
                    maxResolution: 0.3515625,
                    maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
                });
                map.setCenter(new OpenLayers.LonLat(-97.0, 38.0), 1);
                t.eq(layer.getURL(new OpenLayers.Bounds(-135.0, 0.0, -90.0, 45.0)), 
                     "http://www.example.com/foo/2011/foo/arcgis-online/1/1/1.png", "getURL returns correct url");
                map.zoomIn();
                t.eq(layer.getURL(new OpenLayers.Bounds(-180.0, 0.0, -90.0, 90.0)), 
                     "http://www.example.com/foo/2011/foo/arcgis-online/2/2/2.png", "getURL returns correct url");
                map.destroy();
            }
            
            function test_destroy (t) {
                t.plan(3);
                var map = new OpenLayers.Map('map');
                var layer1 = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",  
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),            
                    requestEncoding: "REST"            
                });    
                map.addLayer(layer1);
                layer1.destroy();
                t.eq( layer1.grid, null, "layer.grid is null after destroy" );
                t.eq( layer1.tileSize, null, "layer.tileSize is null after destroy" );

                //test with tile creation
                var layer2 = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",  
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),            
                    requestEncoding: "REST"            
                });    
                map.addLayer(layer2);
                map.setCenter(new OpenLayers.LonLat(0,0), 5);
                //grab a reference to one of the tiles
                var tile = layer2.grid[0][0];        

                layer2.destroy();

                t.ok( layer2.grid == null, "tiles appropriately destroyed");
                map.destroy();
            }    

            function test_getIdentifier(t) {
                t.plan(2);

                var map = new OpenLayers.Map('map');
                var layer, identifier;

                layer = new OpenLayers.Layer.WMTS({
                    name: "Blue Marble WMTS",
                    url: "http://example.com/wmts/",
                    layer: "world",
                    style: "blue_marble",
                    matrixSet: "arcgis_online",
                    tileSize: new OpenLayers.Size(512, 512),
                    requestEncoding: "REST"
                });
                map.addLayer(layer);
                map.setCenter(new OpenLayers.LonLat(0,0), 5);

                layer.zoomOffset = 2;
                identifier = layer.getIdentifier();
                t.eq(identifier, 7, '[zoomOffset] getIdentifier return value is correct');

                layer.serverResolutions = ['offset', 1.40625, 0.703125, 0.3515625, 0.17578125,
                                           0.087890625, 0.0439453125];
                identifier = layer.getIdentifier();
                t.eq(identifier, 6, '[serverResolutions] getIdentifier return value is correct');

                map.destroy();
            }

        </script>
    </head>
    <body>
        <div id="map" style="width:1024px;height:512px;"></div>
        <div id="capabilities"><!--
<Capabilities xmlns="http://www.opengis.net/wmts/1.0"
xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://geowebcache.org/schema/opengis/wmts/1.0.0/wmtsGetCapabilities_response.xsd"
version="1.0.0">
<ows:ServiceIdentification>
  <ows:Title>Web Map Tile Service - GeoWebCache</ows:Title>
  <ows:ServiceType>OGC WMTS</ows:ServiceType>
  <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
</ows:ServiceIdentification>
<ows:ServiceProvider>
  <ows:ProviderName>http://example.com/geowebcache-1.2.2/service/wmts</ows:ProviderName>
  <ows:ProviderSite xlink:href="http://example.com/geowebcache-1.2.2/service/wmts" />
  <ows:ServiceContact>
    <ows:IndividualName>GeoWebCache User</ows:IndividualName>
  </ows:ServiceContact>
</ows:ServiceProvider>
<ows:OperationsMetadata>
  <ows:Operation name="GetCapabilities">
    <ows:DCP>
      <ows:HTTP>
        <ows:Get xlink:href="http://example.com/geowebcache-1.2.2/service/wmts?">
          <ows:Constraint name="GetEncoding">
            <ows:AllowedValues>
              <ows:Value>KVP</ows:Value>
            </ows:AllowedValues>
          </ows:Constraint>
        </ows:Get>
      </ows:HTTP>
    </ows:DCP>
  </ows:Operation>
  <ows:Operation name="GetTile">
    <ows:DCP>
      <ows:HTTP>
        <ows:Get xlink:href="http://example.com/geowebcache-1.2.2/service/wmts?">
          <ows:Constraint name="GetEncoding">
            <ows:AllowedValues>
              <ows:Value>KVP</ows:Value>
            </ows:AllowedValues>
          </ows:Constraint>
        </ows:Get>
      </ows:HTTP>
    </ows:DCP>
  </ows:Operation>
  <ows:Operation name="GetFeatureInfo">
    <ows:DCP>
      <ows:HTTP>
        <ows:Get xlink:href="http://example.com/geowebcache-1.2.2/service/wmts?">
          <ows:Constraint name="GetEncoding">
            <ows:AllowedValues>
              <ows:Value>KVP</ows:Value>
            </ows:AllowedValues>
          </ows:Constraint>
        </ows:Get>
      </ows:HTTP>
    </ows:DCP>
  </ows:Operation>
</ows:OperationsMetadata>
<Contents>
  <Layer>
    <ows:Title>arcgis-online-wms</ows:Title>
    <ows:Abstract>arcgis-online-wms</ows:Abstract>
    <ows:WGS84BoundingBox>
      <ows:LowerCorner>-180.0 -90.0</ows:LowerCorner>
      <ows:UpperCorner>180.0 90.0</ows:UpperCorner>
    </ows:WGS84BoundingBox>
    <ows:Identifier>arcgis-online-wms</ows:Identifier>
    <Style isDefault="true">
      <ows:Identifier>_null</ows:Identifier>
    </Style>
    <Format>image/png</Format>
    <Format>image/jpeg</Format>
    <TileMatrixSetLink>      <TileMatrixSet>arcgis-online-wgs84</TileMatrixSet>
    </TileMatrixSetLink>  </Layer>
  <TileMatrixSet>
    <ows:Identifier>EPSG:4326</ows:Identifier>
    <ows:SupportedCRS>urn:ogc:def:crs:EPSG::4326</ows:SupportedCRS>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:0</ows:Identifier>
      <ScaleDenominator>2.795411320143589E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2</MatrixWidth>
      <MatrixHeight>1</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:1</ows:Identifier>
      <ScaleDenominator>1.3977056600717944E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4</MatrixWidth>
      <MatrixHeight>2</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:2</ows:Identifier>
      <ScaleDenominator>6.988528300358972E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8</MatrixWidth>
      <MatrixHeight>4</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:3</ows:Identifier>
      <ScaleDenominator>3.494264150179486E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16</MatrixWidth>
      <MatrixHeight>8</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:4</ows:Identifier>
      <ScaleDenominator>1.747132075089743E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>32</MatrixWidth>
      <MatrixHeight>16</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:5</ows:Identifier>
      <ScaleDenominator>8735660.375448715</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>64</MatrixWidth>
      <MatrixHeight>32</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:6</ows:Identifier>
      <ScaleDenominator>4367830.1877243575</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>128</MatrixWidth>
      <MatrixHeight>64</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:7</ows:Identifier>
      <ScaleDenominator>2183915.0938621787</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>256</MatrixWidth>
      <MatrixHeight>128</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:8</ows:Identifier>
      <ScaleDenominator>1091957.5469310894</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>512</MatrixWidth>
      <MatrixHeight>256</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:9</ows:Identifier>
      <ScaleDenominator>545978.7734655447</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1024</MatrixWidth>
      <MatrixHeight>512</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:10</ows:Identifier>
      <ScaleDenominator>272989.38673277234</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2048</MatrixWidth>
      <MatrixHeight>1024</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:11</ows:Identifier>
      <ScaleDenominator>136494.69336638617</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4096</MatrixWidth>
      <MatrixHeight>2048</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:12</ows:Identifier>
      <ScaleDenominator>68247.34668319309</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8192</MatrixWidth>
      <MatrixHeight>4096</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:13</ows:Identifier>
      <ScaleDenominator>34123.67334159654</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16384</MatrixWidth>
      <MatrixHeight>8192</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:14</ows:Identifier>
      <ScaleDenominator>17061.83667079827</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>32768</MatrixWidth>
      <MatrixHeight>16384</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:15</ows:Identifier>
      <ScaleDenominator>8530.918335399136</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>65536</MatrixWidth>
      <MatrixHeight>32768</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:16</ows:Identifier>
      <ScaleDenominator>4265.459167699568</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>131072</MatrixWidth>
      <MatrixHeight>65536</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:17</ows:Identifier>
      <ScaleDenominator>2132.729583849784</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>262144</MatrixWidth>
      <MatrixHeight>131072</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:18</ows:Identifier>
      <ScaleDenominator>1066.364791924892</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>524288</MatrixWidth>
      <MatrixHeight>262144</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:19</ows:Identifier>
      <ScaleDenominator>533.182395962446</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1048576</MatrixWidth>
      <MatrixHeight>524288</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:20</ows:Identifier>
      <ScaleDenominator>266.591197981223</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2097152</MatrixWidth>
      <MatrixHeight>1048576</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:21</ows:Identifier>
      <ScaleDenominator>133.2955989906115</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4194304</MatrixWidth>
      <MatrixHeight>2097152</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:22</ows:Identifier>
      <ScaleDenominator>66.64779949530575</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8388608</MatrixWidth>
      <MatrixHeight>4194304</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:23</ows:Identifier>
      <ScaleDenominator>33.323899747652874</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16777216</MatrixWidth>
      <MatrixHeight>8388608</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:24</ows:Identifier>
      <ScaleDenominator>16.661949873826437</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>33554432</MatrixWidth>
      <MatrixHeight>16777216</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:25</ows:Identifier>
      <ScaleDenominator>8.330974936913218</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>67108864</MatrixWidth>
      <MatrixHeight>33554432</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:26</ows:Identifier>
      <ScaleDenominator>4.165487468456609</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>134217728</MatrixWidth>
      <MatrixHeight>67108864</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:27</ows:Identifier>
      <ScaleDenominator>2.0827437342283046</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>268435456</MatrixWidth>
      <MatrixHeight>134217728</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:28</ows:Identifier>
      <ScaleDenominator>1.0413718671141523</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>536870912</MatrixWidth>
      <MatrixHeight>268435456</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:29</ows:Identifier>
      <ScaleDenominator>0.5206859335570762</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1073741824</MatrixWidth>
      <MatrixHeight>536870912</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:4326:30</ows:Identifier>
      <ScaleDenominator>0.2603429667785381</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2147483648</MatrixWidth>
      <MatrixHeight>1073741824</MatrixHeight>
    </TileMatrix>
  </TileMatrixSet>
  <TileMatrixSet>
    <ows:Identifier>arcgis-online-epsg102113</ows:Identifier>
    <ows:SupportedCRS>urn:ogc:def:crs:EPSG::102113</ows:SupportedCRS>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:0</ows:Identifier>
      <ScaleDenominator>5.590822639285715E8</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1</MatrixWidth>
      <MatrixHeight>1</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:1</ows:Identifier>
      <ScaleDenominator>2.7954113196428573E8</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2</MatrixWidth>
      <MatrixHeight>2</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:2</ows:Identifier>
      <ScaleDenominator>1.3977056598214287E8</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4</MatrixWidth>
      <MatrixHeight>4</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:3</ows:Identifier>
      <ScaleDenominator>6.988528299107143E7</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8</MatrixWidth>
      <MatrixHeight>8</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:4</ows:Identifier>
      <ScaleDenominator>3.494264149553572E7</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16</MatrixWidth>
      <MatrixHeight>16</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:5</ows:Identifier>
      <ScaleDenominator>1.747132074776786E7</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>32</MatrixWidth>
      <MatrixHeight>32</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:6</ows:Identifier>
      <ScaleDenominator>8735660.37388393</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>64</MatrixWidth>
      <MatrixHeight>64</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:7</ows:Identifier>
      <ScaleDenominator>4367830.186941965</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>128</MatrixWidth>
      <MatrixHeight>128</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Abstract>The grid was not well-defined, the scale therefore assumes 1m per map unit.</ows:Abstract>      <ows:Identifier>arcgis-online-epsg102113:8</ows:Identifier>
      <ScaleDenominator>2183915.0934709823</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.00375083392E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>256</MatrixWidth>
      <MatrixHeight>256</MatrixHeight>
    </TileMatrix>
  </TileMatrixSet>
  <TileMatrixSet>
    <ows:Identifier>GlobalCRS84Scale</ows:Identifier>
    <ows:SupportedCRS>urn:ogc:def:crs:EPSG::4326</ows:SupportedCRS>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:0</ows:Identifier>
      <ScaleDenominator>5.0000000000000006E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2</MatrixWidth>
      <MatrixHeight>1</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:1</ows:Identifier>
      <ScaleDenominator>2.5000000000000003E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>3</MatrixWidth>
      <MatrixHeight>2</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:2</ows:Identifier>
      <ScaleDenominator>1.0000000000000001E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>6</MatrixWidth>
      <MatrixHeight>3</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:3</ows:Identifier>
      <ScaleDenominator>5.000000000000001E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>12</MatrixWidth>
      <MatrixHeight>6</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:4</ows:Identifier>
      <ScaleDenominator>2.5000000000000004E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>23</MatrixWidth>
      <MatrixHeight>12</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:5</ows:Identifier>
      <ScaleDenominator>1.0E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>56</MatrixWidth>
      <MatrixHeight>28</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:6</ows:Identifier>
      <ScaleDenominator>5000000.0</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>112</MatrixWidth>
      <MatrixHeight>56</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:7</ows:Identifier>
      <ScaleDenominator>2500000.0</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>224</MatrixWidth>
      <MatrixHeight>112</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:8</ows:Identifier>
      <ScaleDenominator>1000000.0000000001</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>560</MatrixWidth>
      <MatrixHeight>280</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:9</ows:Identifier>
      <ScaleDenominator>500000.00000000006</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1119</MatrixWidth>
      <MatrixHeight>560</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:10</ows:Identifier>
      <ScaleDenominator>250000.00000000003</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2237</MatrixWidth>
      <MatrixHeight>1119</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:11</ows:Identifier>
      <ScaleDenominator>100000.00000000001</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>5591</MatrixWidth>
      <MatrixHeight>2796</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:12</ows:Identifier>
      <ScaleDenominator>50000.00000000001</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>11182</MatrixWidth>
      <MatrixHeight>5591</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:13</ows:Identifier>
      <ScaleDenominator>25000.000000000004</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>22364</MatrixWidth>
      <MatrixHeight>11182</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:14</ows:Identifier>
      <ScaleDenominator>10000.000000000002</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>55909</MatrixWidth>
      <MatrixHeight>27955</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:15</ows:Identifier>
      <ScaleDenominator>5000.000000000001</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>111817</MatrixWidth>
      <MatrixHeight>55909</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:16</ows:Identifier>
      <ScaleDenominator>2500.0000000000005</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>223633</MatrixWidth>
      <MatrixHeight>111817</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:17</ows:Identifier>
      <ScaleDenominator>1000.0000000000002</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>559083</MatrixWidth>
      <MatrixHeight>279542</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:18</ows:Identifier>
      <ScaleDenominator>500.0000000000001</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1118165</MatrixWidth>
      <MatrixHeight>559083</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:19</ows:Identifier>
      <ScaleDenominator>250.00000000000006</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2236330</MatrixWidth>
      <MatrixHeight>1118165</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Scale:20</ows:Identifier>
      <ScaleDenominator>100.00000000000003</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>5590823</MatrixWidth>
      <MatrixHeight>2795412</MatrixHeight>
    </TileMatrix>
  </TileMatrixSet>
  <TileMatrixSet>
    <ows:Identifier>EPSG:900913</ows:Identifier>
    <ows:SupportedCRS>urn:ogc:def:crs:EPSG::900913</ows:SupportedCRS>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:0</ows:Identifier>
      <ScaleDenominator>5.590822639508929E8</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1</MatrixWidth>
      <MatrixHeight>1</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:1</ows:Identifier>
      <ScaleDenominator>2.7954113197544646E8</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2</MatrixWidth>
      <MatrixHeight>2</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:2</ows:Identifier>
      <ScaleDenominator>1.3977056598772323E8</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4</MatrixWidth>
      <MatrixHeight>4</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:3</ows:Identifier>
      <ScaleDenominator>6.988528299386162E7</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8</MatrixWidth>
      <MatrixHeight>8</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:4</ows:Identifier>
      <ScaleDenominator>3.494264149693081E7</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16</MatrixWidth>
      <MatrixHeight>16</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:5</ows:Identifier>
      <ScaleDenominator>1.7471320748465404E7</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>32</MatrixWidth>
      <MatrixHeight>32</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:6</ows:Identifier>
      <ScaleDenominator>8735660.374232702</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>64</MatrixWidth>
      <MatrixHeight>64</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:7</ows:Identifier>
      <ScaleDenominator>4367830.187116351</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>128</MatrixWidth>
      <MatrixHeight>128</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:8</ows:Identifier>
      <ScaleDenominator>2183915.0935581755</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>256</MatrixWidth>
      <MatrixHeight>256</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:9</ows:Identifier>
      <ScaleDenominator>1091957.5467790877</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>512</MatrixWidth>
      <MatrixHeight>512</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:10</ows:Identifier>
      <ScaleDenominator>545978.7733895439</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1024</MatrixWidth>
      <MatrixHeight>1024</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:11</ows:Identifier>
      <ScaleDenominator>272989.38669477194</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2048</MatrixWidth>
      <MatrixHeight>2048</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:12</ows:Identifier>
      <ScaleDenominator>136494.69334738597</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4096</MatrixWidth>
      <MatrixHeight>4096</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:13</ows:Identifier>
      <ScaleDenominator>68247.34667369298</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8192</MatrixWidth>
      <MatrixHeight>8192</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:14</ows:Identifier>
      <ScaleDenominator>34123.67333684649</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16384</MatrixWidth>
      <MatrixHeight>16384</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:15</ows:Identifier>
      <ScaleDenominator>17061.836668423246</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>32768</MatrixWidth>
      <MatrixHeight>32768</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:16</ows:Identifier>
      <ScaleDenominator>8530.918334211623</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>65536</MatrixWidth>
      <MatrixHeight>65536</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:17</ows:Identifier>
      <ScaleDenominator>4265.4591671058115</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>131072</MatrixWidth>
      <MatrixHeight>131072</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:18</ows:Identifier>
      <ScaleDenominator>2132.7295835529058</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>262144</MatrixWidth>
      <MatrixHeight>262144</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:19</ows:Identifier>
      <ScaleDenominator>1066.3647917764529</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>524288</MatrixWidth>
      <MatrixHeight>524288</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:20</ows:Identifier>
      <ScaleDenominator>533.1823958882264</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1048576</MatrixWidth>
      <MatrixHeight>1048576</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:21</ows:Identifier>
      <ScaleDenominator>266.5911979441132</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2097152</MatrixWidth>
      <MatrixHeight>2097152</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:22</ows:Identifier>
      <ScaleDenominator>133.2955989720566</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4194304</MatrixWidth>
      <MatrixHeight>4194304</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:23</ows:Identifier>
      <ScaleDenominator>66.6477994860283</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8388608</MatrixWidth>
      <MatrixHeight>8388608</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:24</ows:Identifier>
      <ScaleDenominator>33.32389974301415</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16777216</MatrixWidth>
      <MatrixHeight>16777216</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:25</ows:Identifier>
      <ScaleDenominator>16.661949871507076</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>33554432</MatrixWidth>
      <MatrixHeight>33554432</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:26</ows:Identifier>
      <ScaleDenominator>8.330974935753538</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>67108864</MatrixWidth>
      <MatrixHeight>67108864</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:27</ows:Identifier>
      <ScaleDenominator>4.165487467876769</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>134217728</MatrixWidth>
      <MatrixHeight>134217728</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:28</ows:Identifier>
      <ScaleDenominator>2.0827437339383845</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>268435456</MatrixWidth>
      <MatrixHeight>268435456</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:29</ows:Identifier>
      <ScaleDenominator>1.0413718669691923</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>536870912</MatrixWidth>
      <MatrixHeight>536870912</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>EPSG:900913:30</ows:Identifier>
      <ScaleDenominator>0.5206859334845961</ScaleDenominator>
      <TopLeftCorner>2.0037508E7 -2.003750834E7</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1073741824</MatrixWidth>
      <MatrixHeight>1073741824</MatrixHeight>
    </TileMatrix>
  </TileMatrixSet>
  <TileMatrixSet>
    <ows:Identifier>arcgis-online-wgs84</ows:Identifier>
    <ows:SupportedCRS>urn:ogc:def:crs:EPSG::4326</ows:SupportedCRS>
    <TileMatrix>
      <ows:Identifier>arcgis-online-wgs84:0</ows:Identifier>
      <ScaleDenominator>1.3977056600717944E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>4</MatrixWidth>
      <MatrixHeight>2</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>arcgis-online-wgs84:1</ows:Identifier>
      <ScaleDenominator>6.988528300358972E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>8</MatrixWidth>
      <MatrixHeight>4</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>arcgis-online-wgs84:2</ows:Identifier>
      <ScaleDenominator>3.494264150179486E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16</MatrixWidth>
      <MatrixHeight>8</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>arcgis-online-wgs84:3</ows:Identifier>
      <ScaleDenominator>1.747132075089743E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>32</MatrixWidth>
      <MatrixHeight>16</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>arcgis-online-wgs84:4</ows:Identifier>
      <ScaleDenominator>8735660.375448715</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>64</MatrixWidth>
      <MatrixHeight>32</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>arcgis-online-wgs84:5</ows:Identifier>
      <ScaleDenominator>4367830.1877243575</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>128</MatrixWidth>
      <MatrixHeight>64</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>arcgis-online-wgs84:6</ows:Identifier>
      <ScaleDenominator>2183915.0938621787</ScaleDenominator>
      <TopLeftCorner>85 -175</TopLeftCorner>
      <TileWidth>512</TileWidth>
      <TileHeight>512</TileHeight>
      <MatrixWidth>256</MatrixWidth>
      <MatrixHeight>128</MatrixHeight>
    </TileMatrix>
  </TileMatrixSet>
  <TileMatrixSet>
    <ows:Identifier>GlobalCRS84Pixel</ows:Identifier>
    <ows:SupportedCRS>urn:ogc:def:crs:EPSG::4326</ows:SupportedCRS>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:0</ows:Identifier>
      <ScaleDenominator>7.951392199519542E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1</MatrixWidth>
      <MatrixHeight>1</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:1</ows:Identifier>
      <ScaleDenominator>3.975696099759771E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>2</MatrixWidth>
      <MatrixHeight>1</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:2</ows:Identifier>
      <ScaleDenominator>1.9878480498798856E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>3</MatrixWidth>
      <MatrixHeight>2</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:3</ows:Identifier>
      <ScaleDenominator>1.325232033253257E8</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>5</MatrixWidth>
      <MatrixHeight>3</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:4</ows:Identifier>
      <ScaleDenominator>6.626160166266285E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>9</MatrixWidth>
      <MatrixHeight>5</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:5</ows:Identifier>
      <ScaleDenominator>3.3130800831331424E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>17</MatrixWidth>
      <MatrixHeight>9</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:6</ows:Identifier>
      <ScaleDenominator>1.325232033253257E7</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>43</MatrixWidth>
      <MatrixHeight>22</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:7</ows:Identifier>
      <ScaleDenominator>6626160.166266285</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>85</MatrixWidth>
      <MatrixHeight>43</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:8</ows:Identifier>
      <ScaleDenominator>3313080.0831331424</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>169</MatrixWidth>
      <MatrixHeight>85</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:9</ows:Identifier>
      <ScaleDenominator>1656540.0415665712</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>338</MatrixWidth>
      <MatrixHeight>169</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:10</ows:Identifier>
      <ScaleDenominator>552180.0138555238</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1013</MatrixWidth>
      <MatrixHeight>507</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:11</ows:Identifier>
      <ScaleDenominator>331308.00831331423</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>1688</MatrixWidth>
      <MatrixHeight>844</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:12</ows:Identifier>
      <ScaleDenominator>110436.00277110476</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>5063</MatrixWidth>
      <MatrixHeight>2532</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:13</ows:Identifier>
      <ScaleDenominator>55218.00138555238</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>10125</MatrixWidth>
      <MatrixHeight>5063</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:14</ows:Identifier>
      <ScaleDenominator>33130.80083133143</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>16875</MatrixWidth>
      <MatrixHeight>8438</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:15</ows:Identifier>
      <ScaleDenominator>11043.600277110474</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>50625</MatrixWidth>
      <MatrixHeight>25313</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:16</ows:Identifier>
      <ScaleDenominator>3313.080083133142</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>168750</MatrixWidth>
      <MatrixHeight>84375</MatrixHeight>
    </TileMatrix>
    <TileMatrix>
      <ows:Identifier>GlobalCRS84Pixel:17</ows:Identifier>
      <ScaleDenominator>1104.3600277110472</ScaleDenominator>
      <TopLeftCorner>90.0 -180.0</TopLeftCorner>
      <TileWidth>256</TileWidth>
      <TileHeight>256</TileHeight>
      <MatrixWidth>506250</MatrixWidth>
      <MatrixHeight>253125</MatrixHeight>
    </TileMatrix>
  </TileMatrixSet>
</Contents>
<ServiceMetadataURL xlink:href="http://example.com/geowebcache-1.2.2/service/wmts?REQUEST=getcapabilities&amp;VERSION=1.0.0"/>
</Capabilities>
        -->
        </div>
    </body>
</html>
